import request from '../request.js'

const Api_auth = {
	//注册
	register: function(data) {
		return request({
			url: '/auth/register',
			method: 'POST',
			data: data
		})
	},
	//登录
	login: function(data) {
		return request({
			url: '/auth/login',
			method: 'POST',
			data: data
		})
	},
	//登出
	logout: function() {
		return request({
			url: '/auth/logout',
			method: 'POST'
		})
	},
	//注销
	logclose: function() {
		return request({
			url: '/auth/close',
			method: 'POST'
		})
	},
	//用户信息
	user: function(data) {
		return request({
			url: '/user',
			method: 'GET',
			data:data
		})
	},
	//绑定/更换手机号
	changeMobile: function(data) {
		return request({
			url: '/account/mobile/bind',
			method: 'POST',
			data: data
		})
	},
	//修改登录密码
	updatePassword: function(data) {
		return request({
			url: '/auth/password',
			method: 'POST',
			data: data
		})
	},
	//忘记密码
	forgetPassword: function(data) {
		return request({
			url: '/auth/forget',
			method: 'POST',
			data: data
		})
	},
	//发送验证码
	smsSend: function(data) {
		return request({
			url: '/sms/send',
			method: 'POST',
			data: data
		})
	},
	//内部发送验证码（登录状态下:已注册手机号使用）
	smsSendOwn: function(data) {
		return request({
			url: '/sms/send/own',
			method: 'POST',
			data: data
		})
	},
	//资金密码
	passwordSecond: function(data) {
		return request({
			url: '/auth/password/second',
			method: 'POST',
			data: data,
			showLoading:true
		})
	},
	//实名认证
	certification: function(data) {
		return request({
			url: '/user/kyc',
			method: 'POST',
			data:data
		})
	},
	//绑定更换手机
	changeBindMobile: function(data) {
		return request({
			url: '/auth/change/mobile',
			method: 'POST',
			data: data
		})
	}
}
export default Api_auth
